<?php
/**
 * Created by PhpStorm.
 * User: kkw
 * Date: 2019/1/27
 * Time: 17:41
 */
namespace kkw\goods\table;

use suda\archive\Table;

class GoodsTable extends  Table
{
    public function __construct()
    {
        parent::__construct('goods_table');
    }

    protected function onBuildCreator($table)
    {
        return $table->fields(
            [
            $table->field('id', 'bigint', 20)->primary()->unsigned()->auto(),
            $table->field('user_id', 'bigint', 20)->comment("用户ID"),
            $table->field('goodstype', 'int', 20)->comment("商品类型"),
            $table->field('title', 'varchar', 255)->default(null)->comment("标题"),
            $table->field('describe', 'text')->default(null)->comment("描述"),
            $table->field('price', 'int', 20)->comment("价格"),
            $table->field('qq', 'int', 20)->comment("qq"),
            $table->field('mobile', 'int', 20)->comment("联系电话"),
            $table->field('wechat', 'varchar', 60)->default(null)->comment("微信号"),
            $table->field('time', 'int', 11)->comment("发布时间"),
            $table->field('clicks', 'int', 11)->comment("点击数"),
            $table->field('status', 'tinyint', 3)->comment("是否认证状态"),
            $table->field('address', 'varchar', 60)->default(null)->comment("发布地点"),
            ]);
    }
}